import { post } from '@/service/base'

export const textToAudioStream = (_url: string, _isPublicAPI: boolean, header: { content_type: string }, body: {
  streaming: boolean
  voice?: string
  message_id?: string
  text?: string | null | undefined
}) => {
  return post('/api/text-to-audio', {
    body,
    header,
  }, {
    needAllResponseContent: true,
    prefix: '',
  })
}
export const tts = (text: string) => {
  return post('/api/text-to-audio', {
    body: { text },
    header: { contentType: 'application/json' },
  }, {
    needAllResponseContent: true,
    prefix: '',
  })
}
export const topConversationStream = async (id: string) => {
  return post(`chat-messages/${id}/stop`, { body: {} })
}
